<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.easyui.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/locale/easyui-lang-zh_CN.js"/>"></script>
<link rel="stylesheet" type="text/css" href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/default/easyui.css"/>" />
<link rel="stylesheet" type="text/css" href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/icon.css"/>" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>确认事务中心</title>
</head>
<style>
	#list_lookup{
		width:420px;
	}
</style>
<body>
	<script type="text/javascript">
	$(function() { 
		/*请假确认（添加） */
		$("#leave").linkbutton({
			onClick : function() {
				/* $("#insert").dialog("open"); */
				$("#tboption").panel({
					href : "Confirmation_sheet"
				});
			}
		});
		
		/*补班确认（添加） */
		$("#buban").linkbutton({
			onClick : function() {
				/* $("#insert").dialog("open"); */
				$("#tboption").panel({
					href : "Conbuban_sheet"
				});
			}
		});
		/*外勤确认（添加） */
		$("#waiqin").linkbutton({
			onClick : function() {
				/* $("#insert").dialog("open"); */
				$("#tboption").panel({
					href : "to_field_addition"
				});
			}
		});
		/*加班确认（添加） */
		$("#jiaban").linkbutton({
			onClick : function() {
				/* $("#insert").dialog("open"); */
				$("#tboption").panel({
					href : "to_field_addjiaban"
				});
			}
		});
		/*调休确认（添加） */
		$("#tiaoxiu").linkbutton({
			onClick : function() {
				/* $("#insert").dialog("open"); */
				$("#tboption").panel({
					href : "to_field_addtiaoxiu"
				});
			}
		});
		/*补卡确认（添加） */
		$("#card").linkbutton({
			onClick:function(){
				$("#tboption").panel({
					href : "to_field_addcard"
				});
			}
		});
		/* 清单查找 */
		$('#leaveygId').textbox({
			icons: [{
				iconCls:'icon-add',
				handler: function(e){
					$("#insertemp").dialog("open");
				}
			}]
		});
		
		$('#delectall').linkbutton({
			onClick : function() {
				var rows= $("#dg_operations").datagrid("getChecked");
				if(rows.length==0){
				}else{
					$.messager.confirm('确认', '您确定要删除吗？', function(v){
						if(v){
						for(var i=rows.length-1;i>=0;i--){
							$.post("to_delect_all_options", {conaffId:rows[i].CONAFF_ID}, function(){
								$('#dg_operations').datagrid('reload');
							});
						}
						}else{
							
						}
					});
				}
			
			}
		}); 
		/*获取所选中的一行数据*/
		//双击获取值
			$('#dg_operations').datagrid({
				onDblClickRow:function(index,row){
				var conaffId=row.CONAFF_ID;
				 $("#tboption").panel({
					href : "to_option_leaveupdate?conaffId="+conaffId
				}); 
			}
		});
	});
	
	//所有事物类型
	$('#operation_type_sw').combobox({    
	    url:'find_aff_gory',    
	    valueField:'AFFCA_ID',    
	    textField:'AFFCA_TYPE'   
	});
	$('#operation_type_sw').combobox({
		onSelect:function(record){
			$("#operation_sousuo_text").textbox("setValue","");
			var dName=record.AFFCA_TYPE;
			$("#dg_operations").datagrid({url:"is_all_confair_maffair_sw?affcaType="+dName,method:'get'});
			$("#dg_operations").datagrid("reload");
		}
	});
	$("#operation_sousuo").linkbutton({
		onClick:function(){
			$('#operation_type_sw').combobox("setValue","");
			var Texts = $("#operation_sousuo_text").textbox("getText");
			$("#dg_operations").datagrid({url:"is_all_findFairmaffair_Mohu?stainName="+Texts,method:'get'});
			$("#dg_operations").datagrid("reload");
		}
	});
	</script>
	<div id="tboption" class="easyui-panel"
		data-options="border:false,fit:true">
	<div id="tb">        
		<input class="easyui-combobox" id="operation_type_sw" name="dept" data-options="label:'事务类型', width:200,labelWidth:80,panelHeight:'auto'" />
		<!-- <input id="operation_time1" class= "easyui-datatimebox" data-options="label:'开始日期从', width:200,labelWidth:80">   
		<input id="operation_time2" class= "easyui-datatimebox" data-options="label:'到', width:200,labelWidth:30">    -->
		<input id="operation_sousuo_text" class="easyui-textbox" data-options="width:200"/>
		<a id="operation_sousuo" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">查询</a>  
	</div>
	<div id="bot">
		<a id="leave"class="easyui-linkbutton" data-options="iconCls:'icon-add'">请假确认</a> 
		<a id="buban" class="easyui-linkbutton" data-options="iconCls:'icon-add'">补班确认</a>
		<a id="waiqin" class="easyui-linkbutton" data-options="iconCls:'icon-add'">外勤确认</a>
		<a id="jiaban" class="easyui-linkbutton" data-options="iconCls:'icon-add'">加班确认</a>
		<a id="tiaoxiu" class="easyui-linkbutton" data-options="iconCls:'icon-add'">调休确认</a>
		<a id="card" class="easyui-linkbutton" data-options="iconCls:'icon-add'">补卡确认</a> 
		<a id="delectall" class="easyui-linkbutton" data-options="iconCls:'icon-no'">删除</a> 
	</div>
		<!-- 全部-->
	<table class="easyui-datagrid"
	id="dg_operations"
	data-options="   
		method:'post',
		url:'findall_operation',
		pagination:true,     
		pageSize:10,     
		pageList: [10,20,30,40,50], 
		rownumbers:true,
		fit:true,
		fitColumns:true,
		toolbar:'#tb,#bot'
		">
		<thead>
		<!-- ,
							formatter: function(value,row,index){
							return new Object(row['staffInformation']).stainName;
							}  -->
			<tr>
				<th data-options="field:'CONAFF_ID',width:100,align:'center',checkbox:true">编号</th>
				<th
					data-options="field:'STAIN_ID',width:100,align:'center'">员工编号</th>
				<th
					data-options="field:'STAIN_NAME',width:100,align:'center'">员工名称</th>
				<th
					data-options="field:'HOLIDAY_NAME',width:100,align:'center'">假种</th>
				<th
					data-options="field:'AFFCA_TYPE',width:100,align:'center'">事务类别</th>
				<th data-options="field:'CONAFF_STARTDATE',width:100,align:'center',formatter:function(value,row,index){
					if(value!=null){
						var date = new Date(value);
						return date.toLocaleString();
					}
					return; 
				}">开始假日</th>
				<th data-options="field:'CONAFF_ENDTDATE',width:100,align:'center',formatter:function(value,row,index){
					if(value!=null){
						var date = new Date(value);
						return date.toLocaleString();
					}
					return; 
				}">结束假日</th>
				<th data-options="field:'CONAFF_REASON',width:100,align:'center'">原因</th>
			</tr>
		</thead>
		<tbody>
			
		</tbody>
	</table>
	</div>
</body>
</html>